package com.rc.evcharger.common.enums;

/**
 * 指令下达者
 * Created by sven on 2019/4/25
 */
public enum CommanderEnum {
    //发送通讯指令(0 公众号 1 APP  2小程序 3.刷卡 4.VIN码充电 9.第三方API  默认0)
//    WECHAT("0", "WECHAT"),
    APP("1", "APP"),
    MINI_PROGRAM("2", "MINI_PROGRAM"),
//    CARDNO("3", "CARD"),
//    VIN("4", "VIN"),
//    API("9", "API")
    ;

    private final String code;
    private final String msg;

    CommanderEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    /**
     * 解析code
     *
     * @param code
     * @return
     */
    public static String getCommanderEnum(String code) {
        Class<CommanderEnum> enumClass = CommanderEnum.class;
        for (CommanderEnum commanderEnum : enumClass.getEnumConstants()) {
            if (code.equals(commanderEnum.getCode())) {
                return commanderEnum.getMsg()+",";
            }
        }
        return "";

    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}